1. Field of the Invention
The present invention relates to a data transfer method, a data transfer apparatus and a recording apparatus, and more particularly to a data transfer method, a data transfer apparatus and a recording apparatus for compression transfer of data such as image data, by pack bits compression method in which a tag is given to each unit consisting of a continuous data train containing same data in continuation or a non-continuous data train containing non-same data.
2. Related Background Art
As the information output apparatus for a word processor, personal computer, facsimile or the like, there is already known a printer capable of recording desired information such as characters or an image on a sheet-shaped recording medium such as a paper or film.
There is also recently known a printer capable, in addition to the ordinary recording function, of mounting a scanner unit instead of a recording head which is detachably mounted in such printer and of transferring the image data, read by such scanner unit, to a host equipment.
In the conventional printer, data transferred to a host equipment is of a relatively limited data amount such as error information, but, in the above-described printer with the scanner function, it becomes necessary to transfer a large amount of data, read by the scanner unit, to the host equipment.
In the transfer of recording data from a host equipment to a printer, if the data transfer is executed without data compression, the transfer rate of interfaces connecting the host equipment and the printer generally becomes a bottleneck whereby the throughput of the entire system cannot be increased. In order to overcome such drawback, there has been adopted a method of decreasing the amount of the data to be transferred for example by the pack bits compression, thereby improving the throughput of the entire system.
Also in case of data transfer from the printer to the host equipment, it is conceivable to adopt a compression such as pack bits compression, but such compression increases the burden on the CPU, leading to drawbacks or retarding other processes.
FIG. 3 is a functional block diagram of a portion for executing data transfer in the conventional printer provided with a scanner unit.
Referring to FIG. 3, data read by a scanner unit 110 are transferred to a printer 100 and are written in a pre-compression data reception buffer 101. A data processing unit 102 reads data stored in the pre-compression data reception buffer 101, generates a tag from the read data and writes the tag and the data in a transfer buffer 103. A transfer control unit 104 transfer the data of the transfer buffer 103 to a host equipment 200 together with a control signal according to the protocol of an interface with the host equipment 200.
FIGS. 4A and 4B respectively show examples of data before pack bits compression, stored in the pre-compression data reception buffer 101 and data after ordinary compression, processed by the data processing unit 102 and stored in the transfer buffer 103. The data after ordinary compression consist of repeated cycles of a tag, data, a tag, data, . . . (tags being indicated by underlines).
In the following there will be explained the process executed in the data processing unit 102.
As a tag is written in an initial write address 00, the address is advanced beforehand. As the initial data (at address 00) in the pre-compression data reception buffer are xe2x80x9c10xe2x80x9d, data xe2x80x9c10xe2x80x9d are written in a write address 01 of the transfer buffer. As the next data (at address 01) are xe2x80x9c11xe2x80x9d, data xe2x80x9c11xe2x80x9d are written in a write address 02. The reading process is continued with counting of the number of non-continuous data in parallel.
When the data in the pre-compression data reception buffer are read up to the address 05, it is known that the data of the address 04 are same as those of the address 05. It is therefore known that the number of the non-continuous data is four. Thus the write address of the transfer buffer is returned to 00, and there is written a tag 03 (0000 0011b) indicating that the number of the non-continuous data is four.
Thereafter reading of the data from the pre-compression data reception buffer 101 and writing of the tag and the data into the transfer buffer 103 are similarly continued, executing counting of the number of the continuous and non-continuous data.
In the compression process, as explained in the foregoing, it is necessary to write the tag after reading plural units of data in order to attach the tag in front of the data, and there is required a complex process such as address management. On the other hand, the thawing (expansion) process for decompressing the compressed data is relatively simple as it can be realized by successively reading the data collectively by a number of units indicated by the tag.
In general, the CPU of the host equipment is higher in performance than the CPU of the printer, so that the data processing becomes balanced in case the data compressed by the CPU of the host equipment are thawed by the printer, but the data compression process in the printer requires a long time whereby the throughput in the entire system cannot be improved.
Therefore, in case of transferring the image data read by the scanner unit from the printer to the host equipment, the data are often transferred without compression in the conventional configuration, since the entire process time is often shorter in such data transfer without compression than the data compression and the data transfer in combination.
However, with the recent progress in the resolution and definition of the scanner unit, the amount of the read image data, namely the amount of the data to be transferred, has shown a drastic increase, thereby resulting in a significant increase in the time required for data transfer.
Consequently the function of compressing the data received from the scanner unit within the printer and transferring such data at a high speed to the host equipment has become indispensable.
Such situation is not limited to the printer but is likewise encountered in other peripheral equipment having a function of transferring data of a large amount such as image data to a host equipment such as a personal computer.
In consideration of the foregoing, the object of the present invention is to provide a data transfer method, a data transfer apparatus and a recording apparatus capable of simplifying the process from compression to data transfer, thereby improving the throughput of the entire system.
The above-mentioned object can be attained, according to the present invention, by a data transfer method for compression transfer of data by attaching a tag in the unit of a continuous data train in which same data are present in continuation and a non-continuous data train consisting of non-same data, the method comprising:
a step of reading data stored in a buffer; a tag generation step of generating a tag in the unit of the continuous data train and the non-continuous data train and overwriting, with such tag, an area other than the area storing the aforementioned non-continuous data in the buffer; and a data control step of executing compression transfer of the data by reading the tag from the buffer and transferring the data in the buffer according to the tag.
The above-mentioned object of the present invention can also be attained by a data transfer apparatus for compression transfer of data by attaching a tag in the unit of a continuous data train in which same data are present in continuation and a non-continuous data train consisting of non-same data, the apparatus comprising:
a buffer for storing data; tag generation means for generating a tag in the unit of the continuous data train and the non-continuous data train and overwriting, with such tag, an area other than the area storing the aforementioned non-continuous data in the buffer; and data control means for executing compression transfer of the data by reading the tag from the buffer and transferring the data in the buffer according to the tag.
The above-mentioned object of the present invention can also be attained by a recording apparatus comprising the above-mentioned data transfer apparatus and a carriage for scanning, by a reciprocating motion, a recording medium.
More specifically, in the present invention, in compressing the data of a buffer by a format according to pack bits compression, the data are read from the buffer to generate a tag, then thus generated tag is overwritten in an area of the buffer other than the area where non-same data are present in continuation, then the tag is read from the buffer and the data in the buffer are transferred in a format of the pack bits compression, according to such tag.
In this manner the rearrangement of data becomes unnecessary in compressing the data of the buffer by the pack bits compression, and the number of data writing is also reduced, whereby the data processing for data compression can be achieved with a higher speed.
Such data processing is particularly effective in a printer or the like having a scanner unit to be mounted on a carriage in place for the recording head, because the transfer time can be shortened in transferring the read image data to an external equipment such as a host equipment whereby the throughput of the entire system can be improved.